package com.mapproject.industrymap.controller;
import com.mapproject.industrymap.utils.JwtUtil;
import com.mapproject.industrymap.utils.ReturnValue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/protect")
public class SysProtectInterfaceController {
    @Autowired
    HttpServletRequest request;
    @RequestMapping("/test")
    public ReturnValue testfunc(){
        String value = request.getHeader("Authorization");
        String num=(String) JwtUtil.getBody(value).get("username");
        return new ReturnValue(200,"",num);
    }
}
